package com.xydtech.ecard.ftp.enums;

/**
 * @Author: liliya
 * @Description:
 * ftp_deposit_loan_rate_config
 *   `config_name` varchar(10) DEFAULT NULL COMMENT '期限中文名称'
 * @Date: Created in 2023/8/16 19:36
 * @Modified:
 */

public enum FtpDepositLoanRateConfigKeyMonthTypeEnum {

    M_1("1个月","1M",1),
    M_2("2个月","1M",2),
    M_3("3个月","3M",3),
    M_4("4个月","3M",4),
    M_5("5个月","3M",5),
    M_6("6个月","6M",6),
    M_7("7个月","6M",7),
    M_8("8个月","6M",8),
    M_9("9个月","9M",9),
    M_10("10个月","9M",10),
    M_11("11个月","9M",11),
    M_12("12个月","1Y",12);

    private String configName;
    private String configKey;
    private Integer number;

    FtpDepositLoanRateConfigKeyMonthTypeEnum(String configName, String configKey, Integer number) {
        this.configName = configName;
        this.configKey = configKey;
        this.number = number;
    }

    public String getConfigName() {
        return configName;
    }

    public String getConfigKey() {
        return configKey;
    }

    public Integer getNumber() {
        return number;
    }

    public static FtpDepositLoanRateConfigKeyMonthTypeEnum valuesByKey(String key){
        for(FtpDepositLoanRateConfigKeyMonthTypeEnum enums : FtpDepositLoanRateConfigKeyMonthTypeEnum.values()){
            if(enums.getConfigKey().equals(key)){
                return enums;
            }
        }
        return null;
    }

    public static FtpDepositLoanRateConfigKeyMonthTypeEnum valuesByNumber(Integer numVal){
        for(FtpDepositLoanRateConfigKeyMonthTypeEnum enums : FtpDepositLoanRateConfigKeyMonthTypeEnum.values()){
            if(enums.getNumber().equals(numVal)){
                return enums;
            }
        }
        return null;
    }

}
